#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX_LEN 1000
char octalstr[MAX_LEN] = {'0'};
int octalstr_len = 0;
char decimalstr[MAX_LEN] = {'0'};
int decimalstr_len = 0;


void chu()
{
    int i = 0;
    int dl = strlen(decimalstr);
    int remainder = 0, quotient = 0;
    int divisor = 8;
    for(i = 2; ; i++)
    {
        if(i < dl)
        {
            remainder = remainder * 10 + decimalstr[i] - '0';
        }
        else if(remainder != 0)
        {
            remainder *= 10;
        }
        else
        {
            break;
        }

        if(remainder < divisor)
        {
            quotient = 0;
        }
        else
        {
            quotient = remainder / divisor;
            remainder %= divisor;
        }
        decimalstr[i] = quotient + '0';
    }

    decimalstr[i] = '\0';
    //printf("chu: %s\n", decimalstr);
}

void jia(char* temp)
{
    int i = 0, c = 0, d = 0;
    int dl = strlen(decimalstr);
    int tl = strlen(temp);
    int len = dl < tl ? dl : tl;

    for(i = len-1; i >= 2; i--)
    {
        d = (decimalstr[i] - '0') + (temp[i] - '0') + c;
        c = d / 10;
        decimalstr[i] = d % 10 + '0';
    }
    if(dl < tl)
    {
        for(i = dl; i <= tl; i++)
        {
            decimalstr[i] = temp[i];
        }
    }
    //printf("jia: %s\t%s\n", temp, decimalstr);
}

void trail0()
{
    int i = 0;
    for(i = strlen(decimalstr)-1; i >= 2; i--)
    {
        if(decimalstr[i] != '0')
        {
            break;
        }
        decimalstr[i] = '\0';
    }
}

void process()
{
    int i = 0;
    int d = 0;
    char temp[MAX_LEN] = {'0'};

    strcpy(decimalstr, "0.0");

    for(i = strlen(octalstr)-1; i >= 2; i--)
    {
        d = octalstr[i] - '0';
        chu();
        if(d != 0)
        {
            sprintf(temp, "%f", d * 1.0 / 8.0);
            jia(temp);
        }

    }
    trail0();
    printf("%s [8] = %s [10]\n", octalstr, decimalstr);
}


int main()
{
    //freopen("bin\\debug\\in.txt", "r", stdin);
    //freopen("bin\\debug\\out.txt", "w", stdout);

    while(scanf("%s", octalstr) != EOF)
    {
        process();
    }

    return 0;
}
